﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Kenly.DBFramework.Gateway
{
    /// <summary>
    /// Represents a attribute that contains metadata to describe the Aggregate information of a property.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public sealed class GroupingAttribute : Attribute
    {
        private string _columnName;
        private string _propertyName = "";

        /// <summary>
        /// Represents a attribute that contains metadata to describe the association between container and property,it can be used to marke a property only.
        /// </summary>
        public GroupingAttribute()
        {
        }

        /// <summary>
        /// Represents a attribute that contains metadata to describe the association between container and property,it can be used to marke a property only.
        /// </summary>
        /// <param name="columnName"></param>
        public GroupingAttribute(string columnName)
        {
            _columnName = columnName;
        }

        /// <summary>
        /// 
        /// </summary>
        public string ColumnName
        {
            get
            {
                return _columnName;
            }
            set
            {
                _columnName = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public string PropertyName
        {
            get
            {
                return _propertyName;
            }
            internal set
            {
                _propertyName = value;
            }
        }

    }
}
